home *** CD-ROM | disk | FTP | other *** search
/ Computer Shopper 201 / DPCS1104.ISO / Full / QuickBooks / QBTutor / Lesson5 / Lesson5.dcr / 00208_slippy field Tab handler.ls < prev    next >
Encoding:
Text File  |  2001-02-01  |  2.1 KB  |  65 lines

  1. property spriteNum, preTabProf, preTabProd, preTabServ, postTabProf, postTabProd, postTabServ
  2. global InvoiceFormTemplate
  3.  
  4. on getPropertyDescriptionList
  5.   description = [:]
  6.   addProp(description, #preTabProf, [#default: -1, #format: #integer, #comment: "Backtab Pro.:"])
  7.   addProp(description, #preTabProd, [#default: -1, #format: #integer, #comment: "Backtab Product:"])
  8.   addProp(description, #preTabServ, [#default: -1, #format: #integer, #comment: "Backtab Service:"])
  9.   addProp(description, #postTabProf, [#default: -1, #format: #integer, #comment: "Tab Pro.:"])
  10.   addProp(description, #postTabProd, [#default: -1, #format: #integer, #comment: "Tab Product:"])
  11.   addProp(description, #postTabServ, [#default: -1, #format: #integer, #comment: "Tab Service:"])
  12.   return description
  13. end
  14.  
  15. on keyDown me
  16.   if the key = TAB then
  17.     if the shiftDown then
  18.       threeWaySplit("PRE")
  19.     else
  20.       threeWaySplit("POST")
  21.     end if
  22.   end if
  23.   pass()
  24. end
  25.  
  26. on amIpreLegal me
  27.   if (sprite(spriteNum).locV <= (0 - sprite(spriteNum).height)) or (sprite(spriteNum).locV >= 600) then
  28.     threeWaySplit("PRE")
  29.   end if
  30. end
  31.  
  32. on amIpostLegal me
  33.   if (sprite(spriteNum).locV <= (0 - sprite(spriteNum).height)) or (sprite(spriteNum).locV >= 600) then
  34.     threeWaySplit("POST")
  35.   end if
  36. end
  37.  
  38. on threeWaySplit foreaft
  39.   if foreaft = "PRE" then
  40.     case InvoiceFormTemplate of
  41.       "Professional Invoice":
  42.         the keyboardFocusSprite = preTabProf
  43.         sendSprite(preTabProf, #amIpreLegal)
  44.       "Product Invoice":
  45.         the keyboardFocusSprite = preTabProd
  46.         sendSprite(preTabProd, #amIpreLegal)
  47.       "Service Invoice":
  48.         the keyboardFocusSprite = preTabServ
  49.         sendSprite(preTabServ, #amIpreLegal)
  50.     end case
  51.   else
  52.     case InvoiceFormTemplate of
  53.       "Professional Invoice":
  54.         the keyboardFocusSprite = postTabProf
  55.         sendSprite(postTabProf, #amIpostLegal)
  56.       "Product Invoice":
  57.         the keyboardFocusSprite = postTabProd
  58.         sendSprite(postTabProd, #amIpostLegal)
  59.       "Service Invoice":
  60.         the keyboardFocusSprite = postTabServ
  61.         sendSprite(postTabServ, #amIpostLegal)
  62.     end case
  63.   end if
  64. end
  65.